//
//  Api.swift
//  Asman
//
//  Created by 李旭峰 on 5/20/19.
//  Copyright © 2019 李旭峰. All rights reserved.
//

import Foundation

struct Api {
    ///
    public static let xxcheck = ""
    struct LoginInfo {
        /// 通过微信认证的code查询用户
        public static let checkUserByWechatCode = "/api/user/app/wxLogin"
        /// 通过手机号注册/登录
        public static let loginByPhoneNumber = "/api/user/app/loginByPhoneNumber"
        /// 第三方平台账号绑定手机号
        public static let bindingPhoneNumber = "/api/user/app/bindPhoneNumber"
        /// 获取手机验证码
        public static let sendSmsCode = "/api/user/sendSmsCode"
        /// 绑定微信
        public static let bindingWechat = "/api/user/bindPhoneNumber"
        /// 绑定手机号 该接口弃用？？
        public static let bindingMobile = "/api/user/third/bindPhoneNumber"
        /// 查询审核状态
        public static let checkAuditState = "/web/app/review"
    }
    struct Shipping {
        /// 查询收货地址 / -> 查询联系人列表
        public static let addressList = "/web/shipping/list_address"
        /// 添加收货地址 / -> 添加联系人列表
        public static let addressAdd = "/web/shipping/add_address"
        /// 编辑收货地址 / -> 编辑联系人列表
        public static let addressEdit = "/web/shipping/update_address"
        /// 删除收货地址 / -> 删除联系人列表
        public static let addressDelete = "/web/shipping/delete_address"
    }
    struct Web {
        /// 获取施工项目列表
        public static let projectList = "/web/progress/project_list"
        /// 获取施工阶段列表
        public static let progressStageList = "/web/progress/v2/stage_list"
        /// 获取施工阶段任务列表
        public static let progressStageTaskLise = "/web/progress/v2/stage_task_list"
        /// 获取支付阶段费用项列表
        public static let paymentStateOptionList = "/web/progress/v2/payment_stage_task_list"
        /// 施工概要
        public static let progressOutline = "/web/progress/outline"
        /// 确认验收
        public static let progressConfirmAccept = "/web/progress/confirm_accept"
        /// 确认开工
        public static let progressConfirmProject = "/web/progress/confirm_project"
        /// 获取施工日志列表
//        public static let journalList = "/web/journal/v2/project_journal_list"
        public static let journalList = "/web/journal/v3/project_journal_list"

        /// 获取消息通知列表
        public static let userNotices = "/web/msg/list"
        /// 获取最新一条消息
        public static let getRecentMessage = "/web/msg/get_recent_message"
        /// 创建支付凭证
        public static let paymentCreateCharge = "/web/v2/payment/create_charge"
        /// 根据支付单id查询支付金额
        public static let paymentGetForPayment = "/web/v2/payment/get_for_payment"
        /// 根据支付单id查询支付结果
        public static let getPaymentResult = "/web/v2/payment/get_payment"
        /// 根据支付单id查询支付金额
        public static let getForPayment = "/web/v3/payment/get_for_payment"
        /// 创建支付凭证
        public static let createCharge = "/web/v3/payment/create_charge"
        /// 上传支付凭证
        public static let paymentAddOrder = "/web/payment/order/add_order"
        /// 支付凭证查询
        public static let listOrder = "/web/payment/order/list_order"
        /// 上传身份认证信息
        public static let uploadCertificationInfo = "/web/contract/create_contract"
        /// 加载合同认证信息
        public static let loadContractInfo = "/web/contract/load_contract_data"
        /// 更新合同信息
        public static let uploadContractInfo = "/web/contract/update_contract"
        /// 获取电子合同url
        public static let getContractUrl = "/web/contract/get_contract_url"
        /// 获取用户合同状态
        public static let getContractStatus = "/web/contract/contract_status"
        /// 获取Bucket
        public static let getOssBucket = "/web/oss/get_bucket"
        /// 获取行政区
        public static let districtList = "/web/district/list"
        /// 获取合同附件列表
        public static let getAttachmentList = "/web/contract/get_attachment_list"
        /// 获取工程项目的账单详情
        public static let projectPaymentBill = "/web/progress/project_payment_bill"

        struct Trade {
            public static let partQueryQuotation = "/web/v3/trade/part_query_quotation"
            public static let briefConfirmTrade = "/web/v3/trade/brief_confirm_trade"
        }
        struct im {
            public static let getAutoInfo = "/web/im/get_auth_info"
        }
        struct rtc {
            public static let reject = "/web/rtc/reject"
            public static let answer = "/web/rtc/answer"
            public static let log = "web/rtc/log"
            /// 获取RTC客户记录
            public static let getClientList = "/web/rtc/customer/get_list"
            public static let getAuthInfo = "/web/rtc/get_rtc_auth_info"
            public static let getCallStatus = "/web/rtc/get_call_status2"
            
        }
        /// 摄像头相关
        struct Camera {
            /// 获取摄像头信息
            public static let findCamera = "/web/camera/find_camera"
            /// 获取抓拍图片
            public static let shoot = "/web/camera/shoot"
            /// 旋转摄像头
            public static let turnCamera = "/web/camera/turn_camera"
        }
        struct Scheme {
            /// 收藏方案
            public static let collectionAdd = "/web/scheme/collection/add"
            /// 取消收藏方案
            public static let collectionCancel = "/web/scheme/collection/cancel"
            /// 所有方案类型
            public static let styleList = "/web/scheme/list_all_style"

            struct Get {
                public static let getByBuildingName = "/web/sketch_scheme/list_by_building_name"
            }
            public static let searchById = "/web/scheme/search_scheme_by_id"
        }
    }
    /// 装修方案相关
    struct Plan {
        /// 筛选方案
        public static let sketchSchemeFilter = "/web/sketch_scheme/filter"
        ///
        public static let getBuildingHotBuilding = "/web/building/get_hot_building"
        /// 获取最热楼盘
        public static let getSchemeHotBuilding = "/web/v2/scheme/get_hot_building"
        /// 模糊查询楼盘列表
        public static let getBuildingInfoList = "/web/v2/scheme/get_fuzzy_building"
        /// 查询网红设计师
        public static let getRedDesignList = "/web/v2/scheme/get_red_design_list"
        /// 查询方案列表
        public static let getSchemeList = "/web/v2/scheme/get_scheme_list"
        /// 邻居家页查询方案列表
        public static let getWholeSchemeList = "/web/v2/scheme/get_whole_scheme"
        /// 查询方案概要
        public static let getSchemeOutline = "/web/v2/scheme/get_scheme_outline"
        /// 提交 定制我家 的方案
        public static let addCustomized = "/web/v2/scheme/add_customized"
        /// 查询基础报价单
        public static let queryBasicQuotation = "/web/v2/scheme/query_basic_quotation"
        /// 查询软硬装报价单
        public static let querySoftHardQuotation = "/web/v2/scheme/query_soft_hard_quotation"
    }
    struct User {
        /// 微信登录
        public static let wechatLogin = "/api/user/app/wxLogin";
        public static let getUserInfo = "/api/user/getUserInfo"
        public static let changePhoneNumber = "/api/user/changePhoneNumber"
        /// 获取用户角色
        public static let getRoleInfo = "/api/user/get_role_info"
    }
    struct Order {
        /// 获取订单列表
        public static let getOrderList = "/web/v2/order/get_order_list"
        /// 获取订单详情
        public static let getOrderDetail = "/web/v2/order/get_order_detail"
    }
    struct App {
        public static let versionCheck = "/api/app/version/check"
    }

    ///评分模块接口
    struct Score{
        ///查询标签列表
        public static let scoreTags = "/web/project/review/search"
//        public static let scoreTags = "/web/project/review/search_ios"//这个接口后期需要换成上面，请求参数为 数组
        ///添加评分
        public static let addScore = "/web/project/review/score"
    }

    ///评论模块接口
    struct Comment {
        ///根据评分等级获取评论常用语
        public static let commentTagList = "/web/project/review/quick"
        ///获取评论  列表
        public static let commentList = "/web/project/review/detail"
        ///添加评论,添加回复
        public static let addComent = "/web/project/review/review"
    }
    
    struct Admin {
        struct User {
            public static let confirmLoginStatus = "/admin/user/confirmLoginStatus"
            struct Login {
                public static let chooseEnterprise = "/admin/user/login/chooseEnterprise"
            }
        }
    }
}

struct SchemeServerPath {
    public static let relese:String = "https://vr.asman.com.cn/vr.html"
    public static let test1:String = "https://test.vr.asman.com.cn/vr.html"
    public static let dev:String = "http://dev.vr.asman.com.cn/vr.html"
}
func getVrSetverPath()-> String {
//    return SchemeServerPath.dev
    return SchemeServerPath.test1
//    return SchemeServerPath.relese
}
let programType = WXMiniProgramType.preview
//let programType = WXMiniProgramType.release

let webSocketBaseUrl = "ws://test.portal.asman.com.cn/rtc/notification"
//let webSocketBaseUrl = "ws://121.41.112.230:18080/rtc/notification"
//let webSocketBaseUrl = "wss://portal.asman.com.cn/rtc/notification"

//let host_ipv4:ServerStatus = .cxDevelop
//let host_ipv6:ServerStatus = .cxDevelop
let host_ipv4:ServerStatus = .cxTest_01
let host_ipv6:ServerStatus = .cxTest_01
//let host_ipv4:ServerStatus = .cxRelese_ipv4
//let host_ipv6:ServerStatus = .cxRelese_ipv6


func getRtcWebSocketUrl(_ token:String) -> String {
    return "ws://test.portal.asman.com.cn/rtc/\(token)?deviceType=app"
//    return "ws://121.41.112.230:18080/rtc/\(token)?deviceType=app"
//    return "wss://portal.asman.com.cn/rtc/\(token)?deviceType=app"
}

